package cn.zmit.kuxi.holder;

import java.util.List;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.xdroid.functions.holder.ViewHolderBase;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import cn.zmit.kuxi.R;
import cn.zmit.kuxi.contants.Url;
import cn.zmit.kuxi.entity.OldShareDetailsEntity;
import cn.zmit.kuxi.image.ImageDisplayer;
import cn.zmit.kuxi.request.RequestTask;

/** * @author chenxu @parameter  * @return  */
public class ShareDetailsHorlder extends ViewHolderBase<OldShareDetailsEntity> {
	private Context context;
	private ImageView goodsPic;
	@Override
	public View createView(LayoutInflater layoutInflater) {
		context=layoutInflater.getContext();
		View view=layoutInflater.inflate(R.layout.item_share_details, null);
		goodsPic=(ImageView)view.findViewById(R.id.iamg_share_details);
		return view;
	}

	@Override
	public void showData(int position, OldShareDetailsEntity itemData) {
		List<String>imageUrl=itemData.getImageURLEntities();
		if (imageUrl!=null&&imageUrl.size()>0) {
			for (int i = 0; i < imageUrl.size(); i++) {
				//RequestTask.getInstance().loadImage(context, Url.IMAGE_PICTURES+imageUrl.get(i), goodsPic);
				//ImageLoader.getInstance().displayImage(Url.IMAGE_PICTURES+imageUrl.get(i), goodsPic);
				ImageDisplayer.getInstance().dispalyImageWithRadius(Url.IMAGE_PICTURES+imageUrl.get(i), goodsPic, 0);
			}
		}
	}

}
